<template>
  <div class="box" align="right" style="height: 100px;">

    开户账号:
    <vxe-input v-model="用户账号" placeholder="开户账号" type="input"></vxe-input><br />

    备注:
    <vxe-input v-model="备注" placeholder="" type="input"></vxe-input><br />

    <div>
      <p><vxe-button status="primary" content="立即开户" @click="提交" :loading="加载中" ></vxe-button></p>
    </div>

  </div>

</template>

<script>
export default {
  data() {
    return {
      用户账号: "",
      points: 0,
      备注: "",
    };
  },
  methods: {
    focusEvent1 () {
      this.$refs.xDown1.showPanel()
    },
    keyupEvent1 () {
      const { value1 } = this
      this.list1 = value1 ? this.data1.filter(item => item.label.indexOf(value1) > -1) : this.data1
    },
    selectEvent1 (item) {
      this.value1 = item.label
      this.$refs.xDown1.hidePanel().then(() => {
        this.list1 = this.data1
      })
    },
    提交() {
      this.加载中=true
      const 地址 = "/vip/add/user";
      const 提交数据 = {
        用户账号: this.用户账号,
        备注: this.备注,
      };
      const 成功提示 = (response) => {
        this.加载中=false
        if(response.data.code!==1){
          this.$XModal.message({ content: response.data.message, status: "error" });
        }else{
          this.$XModal.message({ content: "开户成功", status: "success" });
        }
        location.reload()
      };
      const 失败提示 = (response) => {
        this.加载中=false
        this.$XModal.message({ content: "开户失败", status: "success" });
      };
      this.$请求(地址, 提交数据, 成功提示, 失败提示);
    },

  },

};
</script>

<style>

.my-dropdown1 {
  height: 155px;
  overflow: auto;
  border-radius: 4px;
  border: 1px solid #dcdfe6;
  background-color: #fff;
}
.list-item1:hover {
  background-color: #f5f7fa;
}
</style>